package com.zzty.txj1.service.impl;

import com.zzty.txj1.dao.EventDao;
import com.zzty.txj1.entity.Event;
import com.zzty.txj1.service.EventService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EventServiceImpl implements EventService {
    @Autowired
    private EventDao eventDao;

    @Override
    public Event getEventById(Event event) {
        Event event1=eventDao.getEventById(event);
        return event1;
    }

    @Override
    public Integer addEvent(Event event) {
        Integer flag=eventDao.addEvent(event);
        return flag;
    }

    @Override
    public List allEvent(){
        List<Event> events=eventDao.allEvent();
        return events;
    }

    @Override
    public Integer deleteEventById(Integer id) {
        Integer flag=eventDao.deleteEventById(id);
        return flag;
    }
    @Override
    public Integer getEventIdByName(String name) {
        Integer eventId=eventDao.getEventIdByName(name);
        return eventId;
    }

    @Override
    public String getLocationsByEventName(Event event) {
        String locations=eventDao.getLocationsByEventName(event);
        return locations;
    }

    @Override
    public Integer updateLocationById(Event event) {
        Integer count=eventDao.updateEventById(event);
        return count;
    }
    @Override
    public Event getEventById1(Integer id) {
        Event event1=eventDao.getEventById1(id);
        return event1;
    }
}
